package Home_Work.src.day02;

import java.util.Scanner;

/**
 * 测试正则表达式，并尝试编写规则: 电话号码可能有3-4位区号，
 * 7-8位号码:0415-5561111
 * @author Bonnie
 *
 */
public class Test06 {
	public static void main(String[] args) {
		Scanner console = new Scanner(System.in);
		loop:while(true) {
			String str  = console.nextLine();
			String regex = "[0-9]{3,5}\\-[0-9]{7,9}";
			boolean isMat = str.matches(regex);
			if(isMat) {
				System.out.println(str);
				break loop;
			}
		}
	}
}
